Errors in DXL Interaction Screen when connecting through C#

I am using the following C# code for accessing DOORS data.

DOORSCOMLib.DOORS x = new DOORSCOMLib.DOORS();
string DXLStr = "Doors -u \"ala12\" -P \"a123#\" -b \" #include <E:/AnithaL/test1.dxl>;oleSetResult(c)\"";
x.runStr(DXLStr);

DOORS opens correctly, but gives the following errors in the DXL interaction screen.
getting the same DXL errors.
-E- DXL: <Line:1> incorrectly concatenated tokens
-E- DXL: <Line:1> undeclared variable (b)
-E- DXL: <Line:1> undeclared variable (P)
-E- DXL: <Line:1> undeclared variable (u)
-E- DXL: <Line:1> undeclared variable (Doors)
-I- DXL: All done. Errors reported: 5. Warnings reported: 0.
test1.dxl contains this simple function, which works perfect when I do it directly from DOORS.

int max(int a, int b)
{
if a < b then
return b
else
return a
}
print max(4,5)

Please help me to find out the mistakes.
SystemAdmin - Thu Mar 07 06:25:39 EST 2013

Re: Errors in DXL Interaction Screen when connecting through C#
SystemAdmin - Thu Mar 07 06:38:00 EST 2013

Hi

runStr is a method to evaluate a string.
 

string DXLStr = "Doors -u \"ala12\" -P \"a123#\" -b \" #include <E:/AnithaL/test1.dxl>;oleSetResult(c)\"";


Interpret the value of the string as a doors-dxl-script and you get the following script:

Doors -u "ala12" - p "a123#" - b "#include <E:/AnithaL/test1.dxl>;oleSetResult(c)"

But this does not work.


Try:

string DXLStr = "#include <E:/AnithaL/test1.dxl>;\n ack max(3,7) \"\";";

This should work


Best regards
Wolfgang

 

 

 

 

 

Re: Errors in DXL Interaction Screen when connecting through C#
SystemAdmin - Fri Mar 08 04:36:50 EST 2013

Thank you Wolfgang, its working perfect.
Could you please tell me this also, how I can get this value ie 7, in C# code?

Regards,
Anitha

Re: Errors in DXL Interaction Screen when connecting through C#
SystemAdmin - Fri Mar 08 07:28:57 EST 2013

SystemAdmin - Fri Mar 08 04:36:50 EST 2013
Thank you Wolfgang, its working perfect.
Could you please tell me this also, how I can get this value ie 7, in C# code?

Regards,
Anitha

You can try the same procedure as we can use in eval_

In eval_ exists a return_ which itself returns only and onyl a string. So the very first task is to assign the result to a string and then to perform a return_().
 

string DXLStr = "#include <E:/AnithaL/test1.dxl>;\n string sResult = max(3,7) \"\";\n result_(sResult ); \"\";";

Re: Errors in DXL Interaction Screen when connecting through C#
SystemAdmin - Thu Mar 14 05:58:56 EDT 2013

SystemAdmin - Fri Mar 08 07:28:57 EST 2013

You can try the same procedure as we can use in eval_

In eval_ exists a return_ which itself returns only and onyl a string. So the very first task is to assign the result to a string and then to perform a return_().
 

string DXLStr = "#include <E:/AnithaL/test1.dxl>;\n string sResult = max(3,7) \"\";\n result_(sResult ); \"\";";

I tried with this code to get the data,

string DXLStr = "#include <E:/AnithaL/test1.dxl>;\n string sResult = max(3,7) \"\";\n result_(sResult ); \"\";";
x.runStr(DXLStr);
But this result_ returns certain DXL errors.

If my DXL has the following lines, how I could get the Test Description data in my C# program. ie; What are the changes needs to be done in C# side as well as in DXL side? Please consider I am very new to DXL.

string GetTestDescription()[]{
Module m=read("/PlayGround/Anitha/Testcases/DVP Doors",false)

string TestDesc[]={};
Object o;
int i=0;
for o in m do
{
TestDesc[i]=o."Test Description";
i++;
}
close m
return TestDesc;
}

Re: Errors in DXL Interaction Screen when connecting through C#
llandale - Thu Mar 14 15:43:01 EDT 2013

SystemAdmin - Thu Mar 14 05:58:56 EDT 2013
I tried with this code to get the data,

string DXLStr = "#include <E:/AnithaL/test1.dxl>;\n string sResult = max(3,7) \"\";\n result_(sResult ); \"\";";
x.runStr(DXLStr);
But this result_ returns certain DXL errors.

If my DXL has the following lines, how I could get the Test Description data in my C# program. ie; What are the changes needs to be done in C# side as well as in DXL side? Please consider I am very new to DXL.

string GetTestDescription()[]{
Module m=read("/PlayGround/Anitha/Testcases/DVP Doors",false)

string TestDesc[]={};
Object o;
int i=0;
for o in m do
{
TestDesc[i]=o."Test Description";
i++;
}
close m
return TestDesc;
}

[1] Run this from the DXL window to see errors in your string.
  • print checkDXL("halt;#include <E:/AnithaL/test1.dxl>;\n string sResult = max(3,7) \"\";\n result_(sResult ); \"\";";)
I don't think you need the <\"\">as the last line and I think the command is "return_" not "result_".

[2] You MUST decide the exact size of the array when declared. The general structure is:
  • int Size = figure out how many I need; in your case count the objects
  • string Asize
  • for (i=0; i<Size; i++) populate A[i].

[3] The array is on the stack in the function and you CANNOT return it as a function result ..err.. when you do it will get erased on your next function call. I don't recall the weird code-around; but I'd use a Skip list.

-Louie

Re: Errors in DXL Interaction Screen when connecting through C#
SystemAdmin - Fri Mar 15 01:29:11 EDT 2013

llandale - Thu Mar 14 15:43:01 EDT 2013
[1] Run this from the DXL window to see errors in your string.

  • print checkDXL("halt;#include <E:/AnithaL/test1.dxl>;\n string sResult = max(3,7) \"\";\n result_(sResult ); \"\";";)
I don't think you need the <\"\">as the last line and I think the command is "return_" not "result_".

[2] You MUST decide the exact size of the array when declared. The general structure is:
  • int Size = figure out how many I need; in your case count the objects
  • string Asize
  • for (i=0; i<Size; i++) populate A[i].

[3] The array is on the stack in the function and you CANNOT return it as a function result ..err.. when you do it will get erased on your next function call. I don't recall the weird code-around; but I'd use a Skip list.

-Louie

Thanks, I could find out the errors using checkDXL(), the DXL is working fine now. It should be return_.
Next part is I need to find out a way to return the values in C#, for which I will start a new thread after closing this.